﻿<%@ page import="dao.StateDao" %>
<%@ page import="bean.Status" %>
<%@ page import="java.util.List" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <meta content="" name="description"/>
    <meta content="webthemez" name="author"/>
    <title>状态管理</title>
    <link href="assets/css/bootstrap.css" rel="stylesheet"/>
    <link href="assets/css/font-awesome.css" rel="stylesheet"/>
    <link href="assets/css/select2.min.css" rel="stylesheet">
    <link href="assets/css/checkbox3.min.css" rel="stylesheet">
    <link href="assets/css/custom-styles.css" rel="stylesheet"/>
    <link href='https://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'/>
</head>
<jsp:include page="weather.jsp"/>
<body>
<div id="wrapper">
    <jsp:include page="header.jsp"/>
    <!--/. NAV TOP  -->
    <nav class="navbar-default navbar-side" role="navigation">
        <div class="sidebar-collapse">
            <ul class="nav" id="main-menu">

                <li>
                    <a href="index.jsp"><i class="fa fa-dashboard"></i>主控制面板</a>
                </li>
                <li>
                    <a href="peopleManger.jsp"><i class="glyphicon glyphicon-user"></i>人员管理</a>
                </li>

                <li>
                    <a href="#"><i class="fa fa-sitemap"></i> 薪水管理</a>
                </li>
                <li>
                    <a href="taskManager.jsp"><i class="fa fa-qrcode"></i> 任务管理</a>
                </li>

                <li>
                    <a href="areaManager.jsp"><i class="fa fa-table"></i> 区域管理</a>
                </li>
                <li>
                    <a href="stateManager.jsp" class="active-menu"><i class="fa fa-edit"></i> 状态管理 </a>
                </li>
            </ul>

        </div>

    </nav>
    <!-- /. NAV SIDE  -->
    <div id="page-wrapper">
        <!--标题-->
        <div class="header">
            <h1 class="page-header">
                状态管理
            </h1>
        </div>

        <!--内容-->
        <div id="page-inner">

            <div class="col-md-12">
                <div class="row">
                    <div class="pull-right pull-right-margin">
                        <button class="btn btn-success" data-toggle="modal" data-target="#areaAddModal">
                            添加
                        </button>
                        <!-- 模态框（Modal） -->

                        <div class="modal fade" id="areaAddModal" tabindex="-1" role="dialog"
                             aria-labelledby="myModalLabel"
                             aria-hidden="true">
                            <div class="modal-dialog">

                                <div class="modal-content">
                                    <div class="modal-header">
                                        <button type="button" class="close" data-dismiss="modal"
                                                aria-hidden="true">
                                        </button>
                                        <h4 class="modal-title" id="myModalLabel">
                                            添加状态信息
                                        </h4>
                                    </div>
                                    <form action="addStatus" class="form-group">
                                        <div class="modal-body">
                                            <%--表单信息--%>
                                            <div class="form-group">
                                                <label for="stateName">状态名称</label>
                                                <input type="text" class="form-control" id="stateName"
                                                       name="stateName"
                                                       placeholder="状态名称">
                                            </div>

                                        </div>
                                        <div class="modal-footer">
                                            <button type="button" class="btn btn-default" data-dismiss="modal">
                                                关闭
                                            </button>
                                            <button type="submit" class="btn btn-primary">
                                                添加
                                            </button>
                                        </div>
                                    </form>
                                </div>
                                <!-- /.modal-content -->
                            </div><!-- /.modal-dialog -->
                        </div><!-- /.modal -->
                        <script>
                            $(function () {
                                $('#areaAddModal').modal('hide')
                            });
                        </script>

                    </div>
                </div>

                <table class="table">
                    <tr>
                        <td>编号</td>
                        <td>状态名称</td>
                        <td>操作</td>

                    </tr>
                    <%
                        StateDao stateDao = new StateDao();
                        List<Status> list = stateDao.stateList();
                        for (Status status : list
                                ) {
                    %>
                    <tr>
                        <td><%=status.getId()%>
                        </td>
                        <td><%=status.getState()%>
                        </td>
                        <td>
                            <a href="deleteStatus?id=<%=status.getId()%>">删除</a>
                            <a href="updatestate.jsp?id=<%=status.getId()%>">更改</a>

                            <%--&lt;%&ndash;弹出框操作&ndash;%&gt;--%>
                            <%--<div class="modal fade" id="updateModal" tabindex="-1" role="dialog"--%>
                                 <%--aria-labelledby="myModalLabel"--%>
                                 <%--aria-hidden="true">--%>
                                <%--<div class="modal-dialog">--%>

                                    <%--<div class="modal-content">--%>
                                        <%--<div class="modal-header">--%>
                                            <%--<button type="button" class="close" data-dismiss="modal"--%>
                                                    <%--aria-hidden="true">--%>
                                            <%--</button>--%>
                                            <%--<h4 class="modal-title" id="updateModalLabel">--%>
                                                <%--更新状态信息--%>
                                            <%--</h4>--%>
                                        <%--</div>--%>

                                        <%--<form action="updateState?id=<%=status.getId()%>" class="form-group"--%>
                                              <%--method="post">--%>
                                            <%--<div class="modal-body">--%>
                                                <%--&lt;%&ndash;表单信息&ndash;%&gt;--%>
                                                <%--<%--%>
                                                    <%--Status statusSingle = stateDao.getStatus(status.getId());--%>
                                                <%--%>--%>

                                                <%--<div class="form-group">--%>
                                                    <%--<label for="areaid">编号</label>--%>
                                                    <%--<input type="number" class="form-control" id="areaid"--%>
                                                           <%--name="statusId" value="<%=statusSingle.getId()%>"--%>
                                                           <%--placeholder="编号" readonly="readonly">--%>
                                                <%--</div>--%>

                                                <%--<div class="form-group">--%>
                                                    <%--<label for="updateStatus">状态</label>--%>
                                                    <%--<input type="text" class="form-control"--%>
                                                           <%--id="updateStatus" name="statusName"--%>
                                                           <%--value="<%=statusSingle.getState()%>"--%>
                                                           <%--placeholder="状态">--%>
                                                <%--</div>--%>

                                            <%--</div>--%>
                                            <%--<div class="modal-footer">--%>
                                                <%--<button type="button" class="btn btn-default"--%>
                                                        <%--data-dismiss="modal">--%>
                                                    <%--关闭--%>
                                                <%--</button>--%>
                                                <%--<button type="submit" class="btn btn-primary">--%>
                                                    <%--更新--%>
                                                <%--</button>--%>
                                            <%--</div>--%>
                                        <%--</form>--%>
                                    <%--</div>--%>
                                    <!-- /.modal-content -->
                                <%--</div><!-- /.modal-dialog -->--%>
                            <%--</div><!-- /.modal -->--%>
                            <script>
                                $(function () {
                                    $('#updateModal').modal('hide')
                                });
                            </script>


                        </td>
                    </tr>
                    <%
                        }
                    %>
                </table>
            </div>
            <footer><p>Copyright &copy; 2016.Company name All rights reserved.</p></footer>
        </div>
        <!-- /. PAGE INNER  -->
    </div>
    <!-- /. PAGE WRAPPER  -->
</div>
<!-- /. WRAPPER  -->
<!-- JS Scripts-->
<!-- jQuery Js -->
<script src="assets/js/jquery-1.10.2.js"></script>
<!-- Bootstrap Js -->
<script src="assets/js/bootstrap.min.js"></script>
<!-- Metis Menu Js -->
<script src="assets/js/jquery.metisMenu.js"></script>
<script src="assets/js/select2.full.min.js"></script>
<script type="text/javascript">
    $(document).ready(function () {
        $(".selectbox").select2();
    });
</script>
<!-- Custom Js -->
<script src="assets/js/custom-scripts.js"></script>


</body>
</html>
